//打包优化配置
const path = require('path');
function resolve (dir) {
  return path.join(__dirname, '..', dir)
}
const HtmlWebpackPlugin = require('html-webpack-plugin')
const glob = require('glob')
const fs = require('fs')
const qs = require('qs')
const NODE_ENV = process.env.NODE_ENV
const AppName = process.env.AppName
const appConfig={
  externals:{
    'vue': "Vue",
    'vue-router': "VueRouter",
  },
  resolve:{
    extensions: ['.vue', '.js'],
    alias:{
      '@': resolve('sui')
    }
  },
  entry:{
    suiPlugin:resolve('sui/suiPlugin.js')
  },
  definePlugin:{
    'process.env.buildEnv':JSON.stringify(process.env.buildEnv),//dev、stg、prd
  },
  NODE_ENV: NODE_ENV,
  buildEnv: process.env.buildEnv,
  path: NODE_ENV === 'development' ? '' : 'dist/sui', // 打包发布目录
  drop_console: process.env.buildEnv !== 'test', // 打开vconsole
  getHtmlConfigPlugin(){
    return []
  }
}
// 需要维护的版本
module.exports = appConfig
